<template>
  <!-- 热门榜单 -->
  <section class="hot-list">
    <h2>
      <span>热门榜单</span>
      <div>
        <img src="@/assets/images/首页/播放键@2x(1).png" alt="" />
        <span>播放全部</span>
      </div>
    </h2>
    <ul>
      <router-link
        class="li"
        v-for="value of hotList.result"
        :key="value.title"
        :to="/detail/ + value.pdsid"
      >
        <figure>
          <img :src="value.imgUrl" alt="" />
        </figure>
        <div class="right">
          <div class="right-top">
            <h3>{{ value.title }}</h3>
            <p>{{ value.describe }}</p>
          </div>
          <!-- 播放量 -->
          <p>
            <span>{{ value.view }}</span>
            <img src="@/assets/images/首页/播放键@2x(1).png" alt="" />
          </p>
        </div>
      </router-link>
    </ul>
    <!-- 查看全部 -->
    <div class="look-at-all">
      <span>查看全部</span>
      <img src="@/assets/images/首页/矩形17@2x.png" alt="" />
    </div>
  </section>
</template>

<script>
import { onMounted, computed } from "vue";
import { useStore } from "vuex";
export default {
  setup() {
    // 热门榜单列表
    const store = useStore();
    const getHotList = () => store.dispatch("getHotList");
    const hotList = computed(() => store.state.recommend.getHotList);
    onMounted(() => {
      getHotList();
    });
    return {
      hotList,
      getHotList,
    };
  },
};
</script>

<style lang="less" scoped>
// 热门榜单
.hot-list {
  margin-bottom: 21px;
  padding: 0 12px;
  h2 {
    margin-bottom: 12px;
    color: #000000;
    font-size: 18px;
    font-family: PingFang SC;
    font-weight: bold;
    display: flex;
    justify-content: space-between;
    div {
      display: flex;
      align-items: center;
      img {
        width: 16px;
        height: 16px;
        margin-right: 5px;
      }
      span {
        color: #464447;
        font-size: 13px;
      }
    }
  }
  .li {
    margin-bottom: 18px;
    display: flex;
    justify-content: space-between;
    figure {
      margin: 0;
      width: 85px;
      height: 114px;
      margin-right: 14px;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .right {
      flex: 1;
      height: 114px;
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      .right-top {
        h3 {
          margin: 0;
          font-size: 15px;
          color: #444243;
          font-weight: bold;
          margin-bottom: 10px;
        }
        p {
          font-size: 14px;
          color: #a9a9a9;
        }
      }
      p {
        font-size: 12px;
        color: #c9a35c;
        display: flex;
        justify-content: space-between;
        img {
          width: 16px;
          height: 16px;
        }
      }
    }
  }
  // 查看全部
  .look-at-all {
    width: 104px;
    height: 38px;
    background-color: #f8f6f7;
    border-radius: 19px;
    margin: 0 auto;
    margin-bottom: 24px;
    text-align: center;
    display: flex;
    justify-content: center;
    align-items: center;
    span {
      font-size: 14px;
      color: #201e1f;
      margin-right: 9px;
      font-weight: bold;
    }
    img {
      width: 8px;
      height: 14px;
    }
  }
}
</style>
